package cz.muni.pa036.hockeyStats;

/***********************************************************************
 * Module:  Category.java
 * Author:  Rojko
 * Purpose: Defines the Class Category
 ***********************************************************************/

/** @pdOid ef2ed9a3-7cd6-4d8d-a21e-a040916824a8 */
public class Category {
   /** @pdOid 45c6f75b-dec4-4bba-ba37-4f1bd656f69f */
   public int idCategory;
   /** @pdOid a6bfda6c-e865-413f-8342-1facbf31caa3 */
   public java.lang.String categoryName;
   
   /** @pdRoleInfo migr=no name=Team assc=relationship18 coll=java.util.Collection impl=java.util.HashSet mult=0..* */
   public java.util.Collection<Team> team;
   
   
   /** @pdGenerated default getter */
   public java.util.Collection<Team> getTeam() {
      if (team == null)
         team = new java.util.HashSet<Team>();
      return team;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorTeam() {
      if (team == null)
         team = new java.util.HashSet<Team>();
      return team.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newTeam */
   public void setTeam(java.util.Collection<Team> newTeam) {
      removeAllTeam();
      for (java.util.Iterator iter = newTeam.iterator(); iter.hasNext();)
         addTeam((Team)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newTeam */
   public void addTeam(Team newTeam) {
      if (newTeam == null)
         return;
      if (this.team == null)
         this.team = new java.util.HashSet<Team>();
      if (!this.team.contains(newTeam))
         this.team.add(newTeam);
   }
   
   /** @pdGenerated default remove
     * @param oldTeam */
   public void removeTeam(Team oldTeam) {
      if (oldTeam == null)
         return;
      if (this.team != null)
         if (this.team.contains(oldTeam))
            this.team.remove(oldTeam);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllTeam() {
      if (team != null)
         team.clear();
   }

}